using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class t_AccountMap : EntityTypeConfiguration<t_Account>
    {
        public t_AccountMap()
        {
            // Primary Key
            this.HasKey(t => t.FAccountID);

            // Properties
            this.Property(t => t.FAccountID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FNumber)
                .IsRequired()
                .HasMaxLength(40);

            this.Property(t => t.FName)
                .IsRequired()
                .HasMaxLength(80);

            this.Property(t => t.FHelperCode)
                .HasMaxLength(40);

            this.Property(t => t.FBrNo)
                .IsRequired()
                .HasMaxLength(10);

            this.Property(t => t.FTradeNum)
                .HasMaxLength(40);

            this.Property(t => t.FMessage)
                .HasMaxLength(100);

            this.Property(t => t.FFullName)
                .HasMaxLength(250);

            this.Property(t => t.FModifyTime)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(8)
                .IsRowVersion();

            // Table & Column Mappings
            this.ToTable("t_Account");
            this.Property(t => t.FAccountID).HasColumnName("FAccountID");
            this.Property(t => t.FNumber).HasColumnName("FNumber");
            this.Property(t => t.FName).HasColumnName("FName");
            this.Property(t => t.FLevel).HasColumnName("FLevel");
            this.Property(t => t.FDetail).HasColumnName("FDetail");
            this.Property(t => t.FParentID).HasColumnName("FParentID");
            this.Property(t => t.FRootID).HasColumnName("FRootID");
            this.Property(t => t.FGroupID).HasColumnName("FGroupID");
            this.Property(t => t.FDC).HasColumnName("FDC");
            this.Property(t => t.FHelperCode).HasColumnName("FHelperCode");
            this.Property(t => t.FCurrencyID).HasColumnName("FCurrencyID");
            this.Property(t => t.FAdjustRate).HasColumnName("FAdjustRate");
            this.Property(t => t.FEarnAccountID).HasColumnName("FEarnAccountID");
            this.Property(t => t.FQuantities).HasColumnName("FQuantities");
            this.Property(t => t.FUnitGroupID).HasColumnName("FUnitGroupID");
            this.Property(t => t.FMeasureUnitID).HasColumnName("FMeasureUnitID");
            this.Property(t => t.FIsCash).HasColumnName("FIsCash");
            this.Property(t => t.FIsBank).HasColumnName("FIsBank");
            this.Property(t => t.FJournal).HasColumnName("FJournal");
            this.Property(t => t.FContact).HasColumnName("FContact");
            this.Property(t => t.FIsCashFlow).HasColumnName("FIsCashFlow");
            this.Property(t => t.FDetailID).HasColumnName("FDetailID");
            this.Property(t => t.FAcnt).HasColumnName("FAcnt");
            this.Property(t => t.FLoan).HasColumnName("FLoan");
            this.Property(t => t.FDpst).HasColumnName("FDpst");
            this.Property(t => t.FStatedDpst).HasColumnName("FStatedDpst");
            this.Property(t => t.FInterest).HasColumnName("FInterest");
            this.Property(t => t.FIsAcnt).HasColumnName("FIsAcnt");
            this.Property(t => t.FIsBudget).HasColumnName("FIsBudget");
            this.Property(t => t.FAcntID).HasColumnName("FAcntID");
            this.Property(t => t.FBrNo).HasColumnName("FBrNo");
            this.Property(t => t.FAcctint).HasColumnName("FAcctint");
            this.Property(t => t.FintRate).HasColumnName("FintRate");
            this.Property(t => t.FLastintDate).HasColumnName("FLastintDate");
            this.Property(t => t.FAcntType).HasColumnName("FAcntType");
            this.Property(t => t.FTradeNum).HasColumnName("FTradeNum");
            this.Property(t => t.FControl).HasColumnName("FControl");
            this.Property(t => t.FViewMsg).HasColumnName("FViewMsg");
            this.Property(t => t.FMessage).HasColumnName("FMessage");
            this.Property(t => t.FDelete).HasColumnName("FDelete");
            this.Property(t => t.FIsBusi).HasColumnName("FIsBusi");
            this.Property(t => t.FFullName).HasColumnName("FFullName");
            this.Property(t => t.FModifyTime).HasColumnName("FModifyTime");
            this.Property(t => t.FSystemType).HasColumnName("FSystemType");
            this.Property(t => t.FControlSystem).HasColumnName("FControlSystem");
            this.Property(t => t.UUID).HasColumnName("UUID");
            this.Property(t => t.FCFItemID).HasColumnName("FCFItemID");
            this.Property(t => t.FSubCFItemID).HasColumnName("FSubCFItemID");
            this.Property(t => t.FClassTypeID).HasColumnName("FClassTypeID");
        }
    }
}
